package com.hzlx.exception.feign.fallback;

import com.hzlx.MesMaintenanceTasksDtO;
import com.hzlx.ResultDto;
import com.hzlx.exception.feign.EquipmentTaskService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public class EquipmentTaskServiceFallbackFactory implements FallbackFactory<EquipmentTaskService> {
    @Override
    public EquipmentTaskService create(Throwable cause) {
        return new EquipmentTaskService(){
            @Override
            public ResultDto<List<MesMaintenanceTasksDtO>> add(MesMaintenanceTasksDtO mesMaintenanceTasksDto) {

                return  ResultDto.<List<MesMaintenanceTasksDtO>>builder().msg("设备维护任务表添加失败"+cause.getMessage()).build();
            }
        };
    }
}
